home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / emacssrc.zip / EMACSSRC.TAR / emacs-19.17 / lib-src / nmkfile < prev    next >
Text File  |  1993-12-04  |  8KB  |  268 lines

  1. #
  2. #  Hacked up Nmake makefile for GNU Emacs
  3. #
  4. #   Geoff Voelker (voelker@cs.washington.edu)    11-20-93
  5. #
  6. #  This file is part of GNU Emacs.
  7. #  
  8. #  GNU Emacs is free software; you can redistribute it and/or modify
  9. #  it under the terms of the GNU General Public License as published by
  10. #  the Free Software Foundation; either version 2, or (at your option)
  11. #  any later version.
  12. #  
  13. #  GNU Emacs is distributed in the hope that it will be useful,
  14. #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. #  GNU General Public License for more details.
  17. #  
  18. #  You should have received a copy of the GNU General Public License
  19. #  along with GNU Emacs; see the file COPYING.  If not, write to
  20. #  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  21. #
  22.  
  23. # You must have a couple of environment variables set:
  24. #
  25. #     BUILD_DEFAULT_TARGETS must be set to one of "-mips", "-386" or "-alpha"
  26. #        Build for mips assumes r4000.
  27. #
  28. #    INC must ne set the full path to your NT .h files.
  29. #
  30. #    LIB must be set to the full path to your NT .lib files.
  31. #
  32. #
  33.  
  34. !IF "$(BUILD_DEFAULT_TARGETS)" == "-mips"
  35. # Set up the compiler flags for building on mips
  36.  
  37. ARCH           = mips
  38. CFLAGS          = -nologo -D_MIPS_=1 /c /W3 /Od -Gt0 \
  39.             -D__stdcall= -D__cdecl= -DWIN32_LEAN_AND_MEAN
  40.  
  41. #CFLAGS = -std -Wb,-dwalign -G 0 -std -checkstack 4096 -excpt -g0 -Od -EL\
  42. #    -c -Wab,-mips2 -Wab,-diag -DMIPS=1 -DNO_EXT_KEYS -DMIPSEL     \
  43. #    -DCONDITION_HANDLING=1 -DNT_INST=0 -DNT_UP=1 -DJAZZ        \
  44. #    -DR4000 -Olimit 700 
  45.  
  46. !ELSE
  47. !IF "$(BUILD_DEFAULT_TARGETS)" == "-alpha"
  48. # Set up the compiler flags for building on alpha
  49.  
  50. ARCH           = alpha
  51. CFLAGS         = -D_ALPHA_=1 -c -Zed -W2 -O2 \
  52.                 -D__stdcall= -D__cdecl= -DWIN32_LEAN_AND_MEAN 
  53. !ELSE
  54. !IF "$(BUILD_DEFAULT_TARGETS)" == "-386"
  55. # Set up the compiler flags for building on x86
  56.  
  57. ARCH           = i386
  58. CFLAGS           = -nologo -Di386=1 -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 \
  59.         -c -Zel -W2 -H63 -G3d -Ox -Zd
  60.  
  61. !ELSE
  62. !ERROR You must specify BUILD_DEFAULT_TARGETS as either -alpha -mips or -386.
  63. !ENDIF
  64. !ENDIF
  65. !ENDIF
  66.  
  67.  
  68. !IFNDEF INC
  69. !ERROR You need to set INC to the NT .h files directory.
  70. !ELSE
  71. INCP           = -I. -I$(INC) -I$(INC)\crt -I..\src 
  72. !ENDIF
  73.  
  74.  
  75. !IFNDEF LIB
  76. !ERROR You need to set LIB to the NT .lib files directory.
  77. !ENDIF
  78.  
  79. GENERICFLAGS  = -DWINDOWSNT=1 -DSTDC_HEADERS=1 -DNO_LDAV=1 -DNO_ARCHIVES=1
  80. OBJDIR          = obj
  81. BLD          =    $(OBJDIR)\$(ARCH)
  82.  
  83. ALL          =    $(BLD)\cvtmail.exe    \
  84.         $(BLD)\digest-doc.exe    \
  85.         $(BLD)\emacsclient.exe    \
  86.         $(BLD)\make-docfile.exe    \
  87.         $(BLD)\sorted-doc.exe    \
  88.         $(BLD)\test-distrib.exe    \
  89.         $(BLD)\ctags.exe    \
  90.         $(BLD)\etags.exe
  91.  
  92. # don't know what (if) to do with these yet...
  93. #
  94. #        $(BLD)\env.exe        \
  95. #        $(BLD)\wakeup.exe    \
  96. #        $(BLD)\server.exe    \
  97. #        $(BLD)\emacstool.exe    \
  98. #        $(BLD)\fakemail.exe    \
  99. #        $(BLD)\leditcfns.exe    \
  100. #        $(BLD)\movemail.exe    \
  101.  
  102.  
  103. LIBS          =    $(LIB)\setargv.obj    \
  104.         $(LIB)\kernel32.lib    \
  105.         $(LIB)\libc.lib
  106.  
  107. $(BLD)\cvtmail.exe:         $(LIBS) $(BLD)\cvtmail.obj
  108. $(BLD)\digest-doc.exe:         $(LIBS) $(BLD)\digest-doc.obj
  109. $(BLD)\emacsclient.exe:     $(LIBS) $(BLD)\emacsclient.obj
  110. $(BLD)\make-docfile.exe:     $(LIBS) $(BLD)\make-docfile.obj
  111. $(BLD)\qsort.exe:         $(LIBS) $(BLD)\qsort.obj
  112. $(BLD)\sorted-doc.exe:         $(LIBS) $(BLD)\sorted-doc.obj
  113. $(BLD)\test-distrib.exe:     $(LIBS) $(BLD)\test-distrib.obj
  114.  
  115. $(BLD)\ctags.exe:         $(BLD)\etags.exe
  116.     copy $(BLD)\etags.exe $(BLD)\ctags.exe
  117.  
  118. ETAGSOBJ      = $(BLD)\etags.obj \
  119.         $(BLD)\getopt.obj \
  120.         $(BLD)\getopt1.obj
  121.  
  122. $(BLD)\etags.exe:         $(LIBS) $(ETAGSOBJ)
  123.     link32 -out:$@ -debug:PARTIAL -machine:$(ARCH) -align:0x1000 -subsystem:console -entry:mainCRTStartup $(ETAGSOBJ) $(LIBS)
  124.  
  125. #
  126. # don't know what to do with these yet...
  127. #
  128. # $(BLD)\yow.exe:         $(LIBS) $(BLD)\yow.obj
  129. # $(BLD)\emacstool.exe:     $(LIBS) $(BLD)\emacstool.obj
  130. # $(BLD)\env.exe:         $(LIBS) $(BLD)\env.obj
  131. # $(BLD)\fakemail.exe:         $(LIBS) $(BLD)\fakemail.obj
  132. # $(BLD)\leditcfns.exe:     $(LIBS) $(BLD)\leditcfns.obj
  133. # $(BLD)\server.exe:         $(LIBS) $(BLD)\server.obj
  134. # $(BLD)\wakeup.exe:         $(LIBS) $(BLD)\wakeup.obj
  135. # $(BLD)\movemail.exe:         $(LIBS) $(BLD)\movemail.obj
  136.  
  137.  
  138. obj=    dispnew.o frame.o scroll.o xdisp.o window.o \
  139.     term.o cm.o $(XOBJ) \
  140.     emacs.o keyboard.o macros.o keymap.o sysdep.o \
  141.     buffer.o filelock.o insdel.o marker.o \
  142.     minibuf.o fileio.o dired.o filemode.o \
  143.     cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
  144.     alloc.o data.o doc.o editfns.o callint.o \
  145.     eval.o floatfns.o fns.o print.o lread.o \
  146.     abbrev.o syntax.o mocklisp.o bytecode.o \
  147.     process.o callproc.o \
  148.     doprnt.o
  149.  
  150. lispdir = ..\lisp
  151.  
  152. #
  153. # These are the lisp files that are loaded up in loadup.el
  154. #
  155. lisp= \
  156.     $(lispdir)\abbrev.elc \
  157.     $(lispdir)\buff-menu.elc \
  158.     $(lispdir)\byte-run.elc \
  159.     $(lispdir)\c-mode.elc \
  160.     $(lispdir)\files.elc \
  161.     $(lispdir)\fill.elc \
  162.     $(lispdir)\float-sup.elc \
  163.     $(lispdir)\frame.elc \
  164.     $(lispdir)\help.elc \
  165.     $(lispdir)\indent.elc \
  166.     $(lispdir)\isearch.elc \
  167.     $(lispdir)\lisp-mode.elc \
  168.     $(lispdir)\lisp.elc \
  169.     $(lispdir)\loaddefs.el \
  170.     $(lispdir)\map-ynp.elc \
  171.     $(lispdir)\mouse.elc \
  172.     $(lispdir)\page.elc \
  173.     $(lispdir)\paragraphs.elc \
  174.     $(lispdir)\paths.elc \
  175.     $(lispdir)\register.elc \
  176.     $(lispdir)\replace.elc \
  177.     $(lispdir)\scroll-bar.elc \
  178.     $(lispdir)\select.elc \
  179.     $(lispdir)\simple.elc \
  180.     $(lispdir)\startup.elc \
  181.     $(lispdir)\subr.elc \
  182.     $(lispdir)\text-mode.elc \
  183.     $(lispdir)\vc-hooks.elc \
  184.     $(lispdir)\winnt-patch.elc \
  185.     $(lispdir)\window.elc
  186.  
  187. # only do the .c files until we get the docfile stuff fully working
  188. DOC          = DOC
  189. $(DOC):
  190.         rm -f $(DOC)
  191.         $(BLD)\make-docfile -d ..\src $(obj) > $(DOC)
  192.         $(BLD)\make-docfile -d ..\src $(lisp) >> $(DOC)
  193.  
  194.  
  195. !IF "$(BUILD_DEFAULT_TARGETS)" == "-mips"
  196.  
  197. {$(BLD)}.obj{$(BLD)}.exe:
  198.     @- if not exist $(OBJDIR) md $(OBJDIR) >nul 2>&1
  199.     @- if not exist $(BLD) md $(BLD) >nul 2>&1
  200.     @- chmode -r $@ >nul 2>&1
  201.     @- del $@ >nul 2>&1
  202.     @- link32 -out:$@ -debug:PARTIAL -machine:mips -subsystem:console -entry:mainCRTStartup $*.obj $(LIBS)
  203.  
  204. .c{$(BLD)}.obj:
  205.     @- if not exist $(OBJDIR) md $(OBJDIR) >nul 2>&1
  206.     @- if not exist $(BLD) md $(BLD) >nul 2>&1
  207.     @- chmode -r $@ >nul 2>&1
  208.     @- del $@ >nul 2>&1
  209.     @- mcl $(CFLAGS) $(GENERICFLAGS) $(INCP) -Fo$@ $<
  210.  
  211. !ELSE
  212. !IF "$(BUILD_DEFAULT_TARGETS)" == "-alpha"
  213.  
  214.  
  215. {$(BLD)}.obj{$(BLD)}.exe:
  216.     @- if not exist $(OBJDIR) md $(OBJDIR) >nul 2>&1
  217.     @- if not exist $(BLD) md $(BLD) >nul 2>&1
  218.     @- chmode -r $@ >nul 2>&1
  219.     @- del $@ >nul 2>&1
  220.     @- link32 -out:$@ -debug:PARTIAL -machine:alpha -subsystem:console -entry:mainCRTStartup $*.obj $(LIBS)
  221.  
  222. .c{$(BLD)}.obj:
  223.     @- if not exist $(OBJDIR) md $(OBJDIR) >nul 2>&1
  224.     @- if not exist $(BLD) md $(BLD) >nul 2>&1
  225.     @- chmode -r $@ >nul 2>&1
  226.     @- del $@ >nul 2>&1
  227.     @- claxp $(CFLAGS) $(GENERICFLAGS) $(INCP) -Fo$@ $<
  228.  
  229. !ELSE
  230.  
  231. {$(BLD)}.obj{$(BLD)}.exe:
  232.     link32 -out:$@ -debug:PARTIAL -machine:i386 -align:0x1000 -subsystem:console -entry:mainCRTStartup $*.obj $(LIBS)
  233.  
  234. .c{$(BLD)}.obj:
  235.     @- if not exist $(OBJDIR) md $(OBJDIR) >nul 2>&1
  236.     @- if not exist $(BLD) md $(BLD) >nul 2>&1
  237.     @- chmode -r $@ >nul 2>&1
  238.     @- del $@ >nul 2>&1
  239.     @- cl386 $(CFLAGS) $(GENERICFLAGS) $(INCP) -Fo$@ $<
  240.  
  241. !ENDIF
  242. !ENDIF
  243.  
  244. #
  245. # Build the executables
  246. #
  247. all:        $(ALL) $(DOC)
  248.  
  249. #
  250. # Assuming INSTALL_DIR is defined, build and install emacs in it.
  251. # Only install etags, ctags, and the DOC file.
  252. #
  253. CP           = xcopy /fr
  254. INSTALL_FILES = $(BLD)\etags.exe $(BLD)\ctags.exe
  255. install:    $(INSTALL_FILES)
  256.         - mkdir $(INSTALL_DIR)\bin
  257.         $(CP) $(BLD)\etags.exe $(INSTALL_DIR)\bin
  258.         $(CP) $(BLD)\ctags.exe $(INSTALL_DIR)\bin
  259.         - mkdir $(INSTALL_DIR)\data
  260.         $(CP) $(DOC) $(INSTALL_DIR)\data
  261.  
  262. #
  263. # Maintenance
  264. clean:;        del /q *~
  265.         delnode /q deleted
  266.         delnode /q obj
  267.